#include "stdafx.h"
#include "Device.h"
#include "scene/Stage.h"
#include "Input.h"

#if UNI_IOS
    #include "ios/IOSDevice.h"
#endif
#if UNI_WIN32
    #include "win32/Win32Device.h"
#endif

using namespace unigame;

Device* Device::s_device = 0;

Device* Device::currentDevice()
{
    if(!s_device)
    {
#if UNI_IOS
        s_device = uni_new IOSDevice();
#endif
#if UNI_WIN32
		s_device = uni_new Win32Device();
#endif
    }
    return s_device;
}

Device::~Device()
{
    uni_delete_array(m_resourcePath);
	uni_delete_array(m_savePath);
}

void Device::resizeScreen(float w, float h)
{
	m_screenSize.x = w;
	m_screenSize.y = h;
	Stage::instance()->onResizeScreen();
}